from models import*
from django.shortcuts import render_to_response


def index(request):
 Pages = Page.objects.all()
 Category = Categories.objects.all()
 Posts = Post.objects.all().order_by("-created")
 return render_to_response("index.html",locals())

def page(request):
 Pages = Page.objects.all()
 return render_to_response("page.html",{'pages':Pages})

def post (request):
 Posts = Post.objects.all()
 return render_to_response("post.html",locals())
 
 
#def register(request):
 #if request.method == "POST":
  #name = request.POST.get('name','')
  #guestbook_elgedeed = Guestbook.objects.create(owner_name=name)
  #return homepage(request)
 #else:
  #return render_to_response("register.html", RequestContext(request)) 
 
